package com.atXiao.gpt.controller;

import com.atXiao.gpt.common.ResBody;
import com.atXiao.gpt.service.ChartGptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lixiaoxiao
 * @date: 2023/11/16 11:32
 * @version: 1.0
 * @desc:
 */
@RestController
public class ChatController {

    @Autowired
    private ChartGptService gptService;


    @PostMapping("/sendMessage")
    public ResBody sendGptMessage(String prompt) {
        String send = gptService.send(prompt);
        return ResBody.ok(send);
    }


}
